package mercurius.fitness.client.rb.diet;

import java.util.ArrayList;
import java.util.HashMap;

import mercurius.fitness.client.locale.Locale;
import net.pleso.framework.client.dal.IDataColumn;
import net.pleso.framework.client.dal.IDataRow;
import net.pleso.framework.client.dal.db.IDBValue;
import net.pleso.framework.client.dal.db.types.DBDate;
import net.pleso.framework.client.dal.db.types.DBFloat;
import net.pleso.framework.client.dal.db.types.DBInteger;
import net.pleso.framework.client.dal.db.types.DBString;
import net.pleso.framework.client.dal.impl.DataColumn;

public class Diet extends DietInfo implements IDataRow {
	
	private String type = "";
	
	public static final String TYPE_LOG = "log";
	public static final String TYPE_MASTER_REPOSITORY = "masterrep";
	public static final String TYPE_PRIVATE_REPOSITORY = "privaterep";
	
	
	public Diet() {
		
	}
	
	public Diet(HashMap m) {
		super(m);
	}
	
	public String getType() {
		return type;
	}
	
	public void setType(String t) {
		type = t;
	}
	
	
	public class id_column extends Columns {
		public id_column() {
			super("id", "Diet ID", false);
		}

		public IDBValue getCell(Diet row) {
			return new DBInteger(row.getID());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBInteger)
				row.setID(((DBInteger) value).getInteger());
		}
	}
	
	// mdl_mercurius_nutrition_log columns
	public class date_column extends Columns {

		public date_column() {
			super("date", Locale.constants().diet_date_column(), false);
		}

		public IDBValue getCell(Diet row) {
			return new DBDate(row.getDate());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBDate)
				row.setDate(((DBDate) value).getDate());
		}
	}	
	
	
	public class time_column extends Columns {
		
		public time_column() {
			super("time", "Time", false);
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBString)
				row.setTime(((DBString) value).getString());
		}

		public IDBValue getCell(Diet row) {
			return new DBString(row.getTime());
		}
	}
	
	
	public class servings_column extends Columns {
		public servings_column() {
			super("servings", "Servings", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getServings());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setServings(((DBFloat) value).getFloat());
		}
	}
	
	
	public class log_notes_column extends Columns {
		public log_notes_column() {
			super("notes", "Notes", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBString(row.getLogNotes());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBString)
				row.setLogNotes(((DBString) value).getString());
		}
	}
	
	// mdl_mercurius_nutrition_repository
	
	public class name_column extends Columns {
		public name_column() {
			super("name", Locale.constants().diet_name(), true);
		}

		public IDBValue getCell(Diet row) {
			return new DBString(row.getName());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBString)
				row.setName(((DBString) value).getString());
		}
	}
	
	public class pdv_kcalories_column extends Columns {
		public pdv_kcalories_column() {
			super("pdv_kcalories", "DV Calories", false);
		}

		public IDBValue getCell(Diet row) {
			return new DBInteger(row.getPDV());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBInteger)
				row.setPDV(((DBInteger) value).getInteger());
		}
	}
	
	public class amount_column extends Columns {
		public amount_column() {
			super("amount", "Amount", false);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getAmount());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setAmount(((DBFloat) value).getFloat());
		}
	}
	
	public class calories_column extends Columns {
		public calories_column() {
			super("calories", "Calories", false);
		}

		public IDBValue getCell(Diet row) {
			Integer val = row.getCalories();
			if(row.getType().equals(Diet.TYPE_LOG)) {
				val = new Integer((int) (row.getCalories().floatValue() * row.getServings().floatValue()));
			}
			return new DBInteger(val);
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBInteger)
				row.setCalories(((DBInteger) value).getInteger());
		}
	}
	

	public class serving_size_column extends Columns {
			public serving_size_column() {
				super("serving_size", "Serving Size", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getServing_size());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setServing_size(((DBFloat) value).getFloat());
			}
		}


	public class amount_measurement_column extends Columns {
			public amount_measurement_column() {
				super("amount_measurement", "Measurement", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBString(row.getAmount_measurement());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBString)
					row.setAmount_measurement(((DBString) value).getString());
			}
		}


	public class fat_total_column extends Columns {
			public fat_total_column() {
				super("fat_total", "Total Fat", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getFat_total());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setFat_total(((DBFloat) value).getFloat());
			}
		}


	public class fat_saturated_column extends Columns {
			public fat_saturated_column() {
				super("fat_saturated", "Saturated Fat", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getFat_saturated());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setFat_saturated(((DBFloat) value).getFloat());
			}
		}


	public class fat_trans_column extends Columns {
			public fat_trans_column() {
				super("fat_trans", "Trans Fat", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getFat_trans());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setFat_trans(((DBFloat) value).getFloat());
			}
		}


	public class fat_polyunsaturated_column extends Columns {
			public fat_polyunsaturated_column() {
				super("fat_polyunsaturated", "Polyunsaturated Fat", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getFat_polyunsaturated());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setFat_polyunsaturated(((DBFloat) value).getFloat());
			}
		}


	public class fat_monounsaturated_column extends Columns {
			public fat_monounsaturated_column() {
				super("fat_monounsaturated", "Monounsaturated Fat", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getFat_monounsaturated());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setFat_monounsaturated(((DBFloat) value).getFloat());
			}
		}


	public class cholesterol_column extends Columns {
			public cholesterol_column() {
				super("cholesterol", "Cholesterol", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getCholesterol());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setCholesterol(((DBFloat) value).getFloat());
			}
		}


	public class sodium_column extends Columns {
			public sodium_column() {
				super("sodium", "Sodium", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getSodium());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setSodium(((DBFloat) value).getFloat());
			}
		}


	public class potassium_column extends Columns {
			public potassium_column() {
				super("potassium", "Potassium", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getPotassium());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setPotassium(((DBFloat) value).getFloat());
			}
		}


	public class carb_total_column extends Columns {
			public carb_total_column() {
				super("carb_total", "Carbs (Total)", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getCarb_total());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setCarb_total(((DBFloat) value).getFloat());
			}
		}


	public class carb_fiber_dietary_column extends Columns {
			public carb_fiber_dietary_column() {
				super("carb_fiber_dietary", "Fiber (Total)", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getCarb_fiber_dietary());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setCarb_fiber_dietary(((DBFloat) value).getFloat());
			}
		}


	public class carb_fiber_soluble_column extends Columns {
			public carb_fiber_soluble_column() {
				super("carb_fiber_soluble", "Soluble Fiber", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getCarb_fiber_soluble());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setCarb_fiber_soluble(((DBFloat) value).getFloat());
			}
		}


	public class carb_fiber_insoluble_column extends Columns {
			public carb_fiber_insoluble_column() {
				super("carb_fiber_insoluble", "Insoluble Fiber", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getCarb_fiber_insoluble());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setCarb_fiber_insoluble(((DBFloat) value).getFloat());
			}
		}


	public class carb_sugar_column extends Columns {
			public carb_sugar_column() {
				super("carb_sugar", "Sugar", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getCarb_sugar());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setCarb_sugar(((DBFloat) value).getFloat());
			}
		}


	public class carb_other_column extends Columns {
			public carb_other_column() {
				super("carb_other", "Other Carbs", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getCarb_other());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setCarb_other(((DBFloat) value).getFloat());
			}
		}


	public class protein_column extends Columns {
			public protein_column() {
				super("protein", "Protein", true);
			}

			public IDBValue getCell(Diet row) {
				return new DBFloat(row.getProtein());
			}

			public void setCell(Diet row, IDBValue value) {
				if (value instanceof DBFloat)
					row.setProtein(((DBFloat) value).getFloat());
			}
		}
	
	

	public class Vitamin_A_retinol_column extends Columns {
		public Vitamin_A_retinol_column() {
			super("Vitamin_A_retinol", "Vitamin A", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_A_retinol());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_A_retinol(((DBFloat) value).getFloat());
		}
	}

	public class Vitamin_B1_thiamine_column extends Columns {
		public Vitamin_B1_thiamine_column() {
			super("Vitamin_B1_thiamine", "Vitamin B1 (Thiamine)", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_B1_thiamine());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_B1_thiamine(((DBFloat) value).getFloat());
		}
	}

	public class Vitamin_B2_riboflavin_column extends Columns {
		public Vitamin_B2_riboflavin_column() {
			super("Vitamin_B2_riboflavin", "Vitamin B2 (Riboflavin)", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_B2_riboflavin());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_B2_riboflavin(((DBFloat) value).getFloat());
		}
	}

	public class Vitamin_B3_niacin_column extends Columns {
		public Vitamin_B3_niacin_column() {
			super("Vitamin_B3_niacin", "Vitamin B3 (Niacin)", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_B3_niacin());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_B3_niacin(((DBFloat) value).getFloat());
		}
	}

	public class Vitamin_B5_pantothenic_column extends Columns {
		public Vitamin_B5_pantothenic_column() {
			super("Vitamin_B5_pantothenic", "Vitamin B5", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_B5_pantothenic());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_B5_pantothenic(((DBFloat) value).getFloat());
		}
	}

	public class Vitamin_B6_pyridoxine_column extends Columns {
		public Vitamin_B6_pyridoxine_column() {
			super("Vitamin_B6_pyridoxine", "Vitamin B6", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_B6_pyridoxine());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_B6_pyridoxine(((DBFloat) value).getFloat());
		}
	}

	public class Vitamin_B7_biotin_column extends Columns {
		public Vitamin_B7_biotin_column() {
			super("Vitamin_B7_biotin", "Vitamin B7 (Biotin)", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_B7_biotin());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_B7_biotin(((DBFloat) value).getFloat());
		}
	}

	public class Vitamin_B9_folic_column extends Columns {
		public Vitamin_B9_folic_column() {
			super("Vitamin_B9_folic", "Vitamin B9 (Folic)", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_B9_folic());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_B9_folic(((DBFloat) value).getFloat());
		}
	}

	public class Vitamin_B12_cyanocobalamin_column extends Columns {
		public Vitamin_B12_cyanocobalamin_column() {
			super("Vitamin_B12_cyanocobalamin", "Vitamin B12", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_B12_cyanocobalamin());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_B12_cyanocobalamin(((DBFloat) value).getFloat());
		}
	}

	public class Vitamin_choline_column extends Columns {
		public Vitamin_choline_column() {
			super("Vitamin_choline", "Vitamin Choline", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_choline());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_choline(((DBFloat) value).getFloat());
		}
	}

	public class Vitamin_C_scorbic_column extends Columns {
		public Vitamin_C_scorbic_column() {
			super("Vitamin_C_scorbic", "Vitamin C", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_C_scorbic());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_C_scorbic(((DBFloat) value).getFloat());
		}
	}

	public class Vitamin_D_calciferol_column extends Columns {
		public Vitamin_D_calciferol_column() {
			super("Vitamin_D_calciferol", "Vitamin D", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_D_calciferol());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_D_calciferol(((DBFloat) value).getFloat());
		}
	}

	public class Vitamin_E_tocopherol_column extends Columns {
		public Vitamin_E_tocopherol_column() {
			super("Vitamin_E_tocopherol", "Vitamin E", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_E_tocopherol());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_E_tocopherol(((DBFloat) value).getFloat());
		}
	}

	public class Vitamin_K_naphthoquinone_column extends Columns {
		public Vitamin_K_naphthoquinone_column() {
			super("Vitamin_K_naphthoquinone", "Vitamin K", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getVitamin_K_naphthoquinone());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setVitamin_K_naphthoquinone(((DBFloat) value).getFloat());
		}
	}
	
	public class Mineral_Cr_chromium_column extends Columns {
		public Mineral_Cr_chromium_column() {
			super("Mineral_Cr_chromium", "Chromium", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_Cr_chromium());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_Cr_chromium(((DBFloat) value).getFloat());
		}
	}

	public class Mineral_Br_Bromine_column extends Columns {
		public Mineral_Br_Bromine_column() {
			super("Mineral_Br_Bromine", "Bromine", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_Br_Bromine());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_Br_Bromine(((DBFloat) value).getFloat());
		}
	}

	public class Mineral_Co_Cobalt_column extends Columns {
		public Mineral_Co_Cobalt_column() {
			super("Mineral_Co_Cobalt", "Cobalt", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_Co_Cobalt());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_Co_Cobalt(((DBFloat) value).getFloat());
		}
	}

	public class Mineral_Cu_Copper_column extends Columns {
		public Mineral_Cu_Copper_column() {
			super("Mineral_Cu_Copper", "Copper", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_Cu_Copper());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_Cu_Copper(((DBFloat) value).getFloat());
		}
	}

	public class Mineral_Ge_Germanium_column extends Columns {
		public Mineral_Ge_Germanium_column() {
			super("Mineral_Ge_Germanium", "Germanium", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_Ge_Germanium());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_Ge_Germanium(((DBFloat) value).getFloat());
		}
	}

	public class Mineral_I_Iodine_column extends Columns {
		public Mineral_I_Iodine_column() {
			super("Mineral_I_Iodine", "Iodine", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_I_Iodine());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_I_Iodine(((DBFloat) value).getFloat());
		}
	}

	public class Mineral_Fe_Iron_column extends Columns {
		public Mineral_Fe_Iron_column() {
			super("Mineral_Fe_Iron", "Iron", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_Fe_Iron());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_Fe_Iron(((DBFloat) value).getFloat());
		}
	}

	public class Mineral_Mg_Magnesium_column extends Columns {
		public Mineral_Mg_Magnesium_column() {
			super("Mineral_Mg_Magnesium", "Magnesium", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_Mg_Magnesium());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_Mg_Magnesium(((DBFloat) value).getFloat());
		}
	}

	public class Mineral_Mn_Manganese_column extends Columns {
		public Mineral_Mn_Manganese_column() {
			super("Mineral_Mn_Manganese", "Manganese", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_Mn_Manganese());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_Mn_Manganese(((DBFloat) value).getFloat());
		}
	}

	public class Mineral_Mo_Molybdenum_column extends Columns {
		public Mineral_Mo_Molybdenum_column() {
			super("Mineral_Mo_Molybdenum", "Molybdenum", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_Mo_Molybdenum());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_Mo_Molybdenum(((DBFloat) value).getFloat());
		}
	}

	public class Mineral_Se_Selenium_column extends Columns {
		public Mineral_Se_Selenium_column() {
			super("Mineral_Se_Selenium", "Selenium", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_Se_Selenium());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_Se_Selenium(((DBFloat) value).getFloat());
		}
	}

	public class Mineral_Zn_Zinc_column extends Columns {
		public Mineral_Zn_Zinc_column() {
			super("Mineral_Zn_Zinc", "Zinc", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_Zn_Zinc());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_Zn_Zinc(((DBFloat) value).getFloat());
		}
	}

	public class Mineral_Ca_Calcium_column extends Columns {
		public Mineral_Ca_Calcium_column() {
			super("Mineral_Ca_Calcium", "Calcium", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_Ca_Calcium());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_Ca_Calcium(((DBFloat) value).getFloat());
		}
	}

	public class Mineral_P_Phosphorus_column extends Columns {
		public Mineral_P_Phosphorus_column() {
			super("Mineral_P_Phosphorus", "Phosphorus", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_P_Phosphorus());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_P_Phosphorus(((DBFloat) value).getFloat());
		}
	}
	
	public class Mineral_S_Sulfur_column extends Columns {
		public Mineral_S_Sulfur_column() {
			super("Mineral_S_Sulfur", "Sulfur", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_S_Sulfur());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_S_Sulfur(((DBFloat) value).getFloat());
		}
	}
	
	public class Mineral_V_Vanadium_column extends Columns {
		public Mineral_V_Vanadium_column() {
			super("Mineral_V_Vanadium", "Vanadium", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBFloat(row.getMineral_V_Vanadium());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBFloat)
				row.setMineral_V_Vanadium(((DBFloat) value).getFloat());
		}
	}
	
	public class nutrition_notes_column extends Columns {
		public nutrition_notes_column() {
			super("notes", "Nutrition Notes", true);
		}

		public IDBValue getCell(Diet row) {
			return new DBString(row.getNutritionNotes());
		}

		public void setCell(Diet row, IDBValue value) {
			if (value instanceof DBString)
				row.setNutritionNotes(((DBString) value).getString());
		}
	}
	
	
	
	
	private static ArrayList columns = new ArrayList();
	private static final Diet instance = new Diet();
	
	public abstract static class Columns extends DataColumn {
		
		public Columns(String name, String caption, boolean allowNull) {
			super(name, caption, allowNull);
			columns.add(this);
			this.order = columns.size(); 
		}
		
		
		public abstract void setCell(Diet row, IDBValue value);
		public abstract IDBValue getCell(Diet row);
		
		public static final id_column id = instance.new id_column();
			
//			 mdl_mercurius_nutrition_log columns
			
		public static final date_column date = instance.new date_column();
		public static final time_column time = instance.new time_column();
		public static final servings_column servings = instance.new servings_column();
		public static final log_notes_column log_notes= instance.new log_notes_column();
			
//			 mdl_mercurius_nutrition_repository
			
		public static final name_column name = instance.new name_column();
		public static final pdv_kcalories_column pdv_kcalories = instance.new pdv_kcalories_column();
		public static final calories_column calories = instance.new calories_column();
		public static final serving_size_column serving_size = instance.new serving_size_column();
		public static final amount_column amount = instance.new amount_column();
		public static final amount_measurement_column amount_measurement = instance.new amount_measurement_column();
		public static final fat_total_column fat_total = instance.new fat_total_column();
		public static final fat_saturated_column fat_saturated = instance.new fat_saturated_column();
		public static final fat_trans_column fat_trans = instance.new fat_trans_column();
		public static final fat_polyunsaturated_column fat_polyunsaturated= instance.new fat_polyunsaturated_column();
		public static final fat_monounsaturated_column fat_monounsaturated= instance.new fat_monounsaturated_column();
		public static final cholesterol_column cholesterol = instance.new cholesterol_column();
		public static final sodium_column sodium = instance.new sodium_column();
		public static final potassium_column potassium = instance.new potassium_column();
		public static final carb_total_column carb_total = instance.new carb_total_column();
		public static final carb_fiber_dietary_column carb_fiber_dietary = instance.new carb_fiber_dietary_column();
		public static final carb_fiber_soluble_column carb_fiber_soluble = instance.new carb_fiber_soluble_column();
		public static final carb_fiber_insoluble_column carb_fiber_insoluble = instance.new carb_fiber_insoluble_column();
		public static final carb_sugar_column carb_sugar = instance.new carb_sugar_column();
		public static final carb_other_column carb_other= instance.new carb_other_column();
		public static final protein_column protein = instance.new protein_column();
		public static final Vitamin_A_retinol_column Vitamin_A_retinol = instance.new Vitamin_A_retinol_column();
		public static final Vitamin_B1_thiamine_column Vitamin_B1_thiamine = instance.new Vitamin_B1_thiamine_column();
		public static final Vitamin_B2_riboflavin_column Vitamin_B2_riboflavin = instance.new Vitamin_B2_riboflavin_column();
		public static final Vitamin_B3_niacin_column Vitamin_B3_niacin = instance.new Vitamin_B3_niacin_column();
		public static final Vitamin_B5_pantothenic_column Vitamin_B5_pantothenic = instance.new Vitamin_B5_pantothenic_column();
		public static final Vitamin_B6_pyridoxine_column Vitamin_B6_pyridoxine = instance.new Vitamin_B6_pyridoxine_column();
		public static final Vitamin_B7_biotin_column Vitamin_B7_biotin = instance.new Vitamin_B7_biotin_column();
		public static final Vitamin_B9_folic_column Vitamin_B9_folic = instance.new Vitamin_B9_folic_column();
		public static final Vitamin_B12_cyanocobalamin_column Vitamin_B12_cyanocobalamin = instance.new Vitamin_B12_cyanocobalamin_column();
		public static final Vitamin_choline_column Vitamin_choline = instance.new Vitamin_choline_column();
		public static final Vitamin_C_scorbic_column Vitamin_C_scorbic = instance.new Vitamin_C_scorbic_column();
		public static final Vitamin_D_calciferol_column Vitamin_D_calciferol = instance.new Vitamin_D_calciferol_column();
		public static final Vitamin_E_tocopherol_column Vitamin_E_tocopherol = instance.new Vitamin_E_tocopherol_column();
		public static final Vitamin_K_naphthoquinone_column Vitamin_K_naphthoquinone = instance.new Vitamin_K_naphthoquinone_column();
		public static final Mineral_Cr_chromium_column Mineral_Cr_chromium = instance.new Mineral_Cr_chromium_column();
		public static final Mineral_Br_Bromine_column Mineral_Br_Bromine = instance.new Mineral_Br_Bromine_column();
		public static final Mineral_Co_Cobalt_column Mineral_Co_Cobalt = instance.new Mineral_Co_Cobalt_column();
		public static final Mineral_Cu_Copper_column Mineral_Cu_Copper = instance.new Mineral_Cu_Copper_column();
		public static final Mineral_Ge_Germanium_column Mineral_Ge_Germanium = instance.new Mineral_Ge_Germanium_column();
		public static final Mineral_I_Iodine_column Mineral_I_Iodine = instance.new Mineral_I_Iodine_column();
		public static final Mineral_Fe_Iron_column Mineral_Fe_Iron = instance.new Mineral_Fe_Iron_column();
		public static final Mineral_Mg_Magnesium_column Mineral_Mg_Magnesium = instance.new Mineral_Mg_Magnesium_column();
		public static final Mineral_Mn_Manganese_column Mineral_Mn_Manganese = instance.new Mineral_Mn_Manganese_column();
		public static final Mineral_Mo_Molybdenum_column Mineral_Mo_Molybdenum = instance.new Mineral_Mo_Molybdenum_column();
		public static final Mineral_Se_Selenium_column Mineral_Se_Selenium = instance.new Mineral_Se_Selenium_column();
		public static final Mineral_Zn_Zinc_column Mineral_Zn_Zinc = instance.new Mineral_Zn_Zinc_column();
		public static final Mineral_Ca_Calcium_column Mineral_Ca_Calcium = instance.new Mineral_Ca_Calcium_column();
		public static final Mineral_P_Phosphorus_column Mineral_P_Phosphorus = instance.new Mineral_P_Phosphorus_column();
		public static final Mineral_S_Sulfur_column Mineral_S_Sulfur = instance.new Mineral_S_Sulfur_column();
		public static final Mineral_V_Vanadium_column Mineral_V_Vanadium = instance.new Mineral_V_Vanadium_column();
		public static final nutrition_notes_column nutrition_notes = instance.new nutrition_notes_column();
	}

	public IDBValue getCell(IDataColumn column) {
		Columns col = (Columns) column;
		return col.getCell(this);
	}

	public IDataColumn getColumn(int index) {
		return (IDataColumn) columns.get(index);
	}

	public int getColumnCount() {
		return columns.size();
	}

	public void setCell(IDataColumn column, IDBValue value) {
		Columns col = (Columns) column;
		col.setCell(this, value);
	}

}
